import { ref } from 'vue';
import { getOrderProduceDetailApi } from '@/api/sj/productManagement/integratedProduction';

const useWorkOrderDetail = () => {

    const detailVisible = ref(false);
    const detailObj = ref<any>();

    /** 打开详情弹窗 */
    const handlOpenDetails = async (row: any) => {
        const { code, data } = await getOrderProduceDetailApi(row.childrenOrderId);
        if (code == 200) {
            detailObj.value = data
            detailVisible.value = true;
        }
    };

    /** 关闭定稿弹窗 */
    const handlOpenDetailsClose = () => {
        detailVisible.value = false;
    };

    return {
        detailVisible,
        detailObj,
        handlOpenDetails,
        handlOpenDetailsClose
    }
};

export default useWorkOrderDetail;
